LassoScript Utility
Basics Browse Detail

[Image->Scale]

Tag Link [Image->Scale] Category Image
Type Member Source Available No
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

Scales an image to a specified size. Requries -Width and/or -Height parameters, which specifiy the new size of the image using either integer pixel values or string percentage values (e.g. '50%'). An optional -Sample parameter uses pixel sampling so that no additional colors are introduced into the image. An optional -Thumbnail parameter indicates the image will be optimized for display on the Web. If only one of the -Width or -Height is specified then the other value is calculated proportionally.

Syntax

[Image Variable->(Scale: -Height=Integer, -Thumbnail]
[Image Variable->(Scale: -Width=Integer, -Sample]

Parameters

Required Parameters
-Width Specifies the new width of the image using either integer pixel values or string percentage values (e.g. '50%').
-Height Specifies the new height of the image using either integer pixel values or string percentage values (e.g. '50%').
Optional Parameters
-Sample Indicates pixel sampling should be used.
-Thumbnail Optimizes the image for display on the Web.

Examples

To enlarge an image:

Use the [Image->Scale] tag on a defined image variable. The following example enlarges image.jpg to 225 X 225 pixels. The optional -Sample parameter specifies that the highest-quality sampling should be used.

[Var: 'MyImage' =(Image: '/images/image.jpg')]
[$MyImage->(Scale: -Height=225, -Width=225, -Sample)]
[$MyImage->(Save: '/images/image.jpg')]

To contract an image:

Use the [Image->Scale] tag on a defined image variable. The following example contracts image.jpg to 25 X 25 pixels. The optional -Thumbnail parameter optimizes the image for the Web.

[Var: 'MyImage' =(Image: '/images/image.jpg')]
[$MyImage->(Scale: -Height=25, -Width=25, -Thumbnail)]
[$MyImage->(Save: '/images/image.jpg')]